function titleCase(title, minorWords="") {
    var minWord = minorWords.toLowerCase().split(" ")
    return title.split(" ").map((w, index) => {
        return (minWord.indexOf(w.toLowerCase()) != -1 && index != 0) ? w.toLowerCase() : w.charAt(0).toUpperCase() + w.toLowerCase().slice(1)
    }).join(" ");
}

console.log(titleCase("THE WIND IN THE WILLOWS", "The In"))
